﻿Imports ControleMatricula.Negocio

Public Class MDIRibbonControle
    Dim db As New DataClassesDataContext()

    Private Sub MDIRibbon_SelectedTabChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MDIRibbon.SelectedTabChanged

    End Sub

    Private Sub SubMnuCadastroAluno_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuCadastroAluno.Click
        Dim SubMnuCadastroAluno As FrmAlunoCompleto
        SubMnuCadastroAluno = New FrmAlunoCompleto
        SubMnuCadastroAluno.Owner = Me
        SubMnuCadastroAluno.MdiParent = Me
        SubMnuCadastroAluno.Show()
    End Sub

    Private Sub SubMnuCadastroEspecifica_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuCadastroEspecifica.Click
        Dim SubMnuEspecifica As FrmEspecifica
        SubMnuEspecifica = New FrmEspecifica
        SubMnuEspecifica.Owner = Me
        SubMnuEspecifica.MdiParent = Me
        SubMnuEspecifica.Show()
    End Sub

    Private Sub SubMnuCadastroFuncionario_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuCadastroFuncionario.Click
        Dim SubMnuFuncionario As FrmFuncionario
        SubMnuFuncionario = New FrmFuncionario
        SubMnuFuncionario.Owner = Me
        SubMnuFuncionario.MdiParent = Me
        SubMnuFuncionario.Show()
    End Sub

    Private Sub SubMnuCadastroPagamento_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuCadastroPagamento.Click
        Dim SubMnuPagamento As FrmPagamento
        SubMnuPagamento = New FrmPagamento
        SubMnuPagamento.Owner = Me
        SubMnuPagamento.MdiParent = Me
        SubMnuPagamento.Show()
    End Sub

    Private Sub SubMnuListaAluno_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuListaAluno.Click
        Dim SubMnuListaAluno As FrmListaAluno
        SubMnuListaAluno = New FrmListaAluno
        SubMnuListaAluno.Owner = Me
        SubMnuListaAluno.MdiParent = Me
        SubMnuListaAluno.Show()
    End Sub

    Private Sub SubMnuLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuLogin.Click

        For Each oForm In Me.MdiChildren
            If Not IsNothing(oForm) Then
                oForm.Close()
            End If
        Next

        Me.Opacity = 0.8

        System.Diagnostics.Debug.WriteLine(AnimateWindow(Me.Handle.ToInt32, 2000, &H5S Or &H80000))
        Me.WindowState = FormWindowState.Maximized

        System.Threading.Thread.CurrentThread.CurrentCulture = _
            New System.Globalization.CultureInfo("pt-BR")

        Dim login As New FrmLogin
        login.ShowDialog()

    End Sub
    Private Declare Function AnimateWindow Lib "user32" (ByVal hWnd As Integer, ByVal dwTime As Integer, ByVal dwFlags As Integer) As Integer

    Private Sub SubMnuRelGeral_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuRelGeral.Click
        Dim SubMnuRelMatriculaDiaria As FrmRelGeral
        SubMnuRelMatriculaDiaria = New FrmRelGeral
        SubMnuRelMatriculaDiaria.Owner = Me
        SubMnuRelMatriculaDiaria.MdiParent = Me
        SubMnuRelMatriculaDiaria.Show()
    End Sub

    Private Sub SubMnuRelMatriculaDiaria_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubMnuRelMatriculaDiaria.Click
        Dim SubMnuRelMatriculaDiaria As FrmRelMatriculaDiaria
        SubMnuRelMatriculaDiaria = New FrmRelMatriculaDiaria
        SubMnuRelMatriculaDiaria.Owner = Me
        SubMnuRelMatriculaDiaria.MdiParent = Me
        SubMnuRelMatriculaDiaria.Show()
    End Sub

    Private Sub MDIRibbonControle_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.Text = GlobalVersaoMDI

        Me.Opacity = 0.8

        System.Diagnostics.Debug.WriteLine(AnimateWindow(Me.Handle.ToInt32, 2000, &H5S Or &H80000))
        Me.WindowState = FormWindowState.Maximized

        System.Threading.Thread.CurrentThread.CurrentCulture = _
            New System.Globalization.CultureInfo("pt-BR")

        Dim login As New FrmLogin
        login.ShowDialog()

        Dim UsuarioLogado As New List(Of SPFuncionarioConsultarResult)
        UsuarioLogado = db.SPFuncionarioConsultar(GlobalLogin, "").ToList()

        Me.lblUsuarioLogadoStatus.Text = "Usuário Logado: " & UsuarioLogado(0).Nome & "   " & System.DateTime.Today.ToLongDateString()

        'Dim Facebook As New Facebook
        'Facebook.ShowDialog()

    End Sub

    Private Sub btnSpecOpcoes_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSpecOpcoes.Click

        Dim Opecoes As frmOpcoes
        Opecoes = New frmOpcoes
        Opecoes.Owner = Me
        Opecoes.MdiParent = Me
        Opecoes.Show()

    End Sub
    Function PossuiAcesso(ByVal _cdAcesso As Integer) As Boolean

    End Function
    Function PossuiAcesso(ByVal _tag As String) As Boolean

    End Function

    Private Sub SubMenuAdminRecebimento_Click(sender As System.Object, e As System.EventArgs) Handles SubMenuAdminRecebimento.Click
        Dim Recebimento As FrmRecebimentoPagamento
        Recebimento = New FrmRecebimentoPagamento
        Recebimento.Owner = Me
        Recebimento.MdiParent = Me
        Recebimento.Show()
    End Sub

    Private Sub SubMenuAdmRelContatos_Click(sender As Object, e As System.EventArgs) Handles SubMenuAdmRelContatos.Click
        Dim RelContatos As FrmRelContatos
        RelContatos = New FrmRelContatos
        RelContatos.Owner = Me
        RelContatos.MdiParent = Me
        RelContatos.Show()
    End Sub

    Private Sub SubMenuAdminDesativaAlunos_Click(sender As Object, e As System.EventArgs) Handles SubMenuAdminDesativaAlunos.Click
        Dim DesativaAlunos As FrmDesativaAlunos
        DesativaAlunos = New FrmDesativaAlunos
        DesativaAlunos.Owner = Me
        DesativaAlunos.MdiParent = Me
        DesativaAlunos.Show()
    End Sub

    Private Sub SubMenuAdmRelMontante_Click(sender As Object, e As System.EventArgs) Handles SubMenuAdmRelMontante.Click
        Dim MontanteRecebimento As FrmRelMontanteRecebimento
        MontanteRecebimento = New FrmRelMontanteRecebimento
        MontanteRecebimento.Owner = Me
        MontanteRecebimento.MdiParent = Me
        MontanteRecebimento.Show()
    End Sub

    Private Sub SubMenuAdmRelDistribuicao_Click(sender As Object, e As System.EventArgs) Handles SubMenuAdmRelDistribuicao.Click
        Dim RelDistribuicao As FrmRelDistribuicao
        RelDistribuicao = New FrmRelDistribuicao
        RelDistribuicao.Owner = Me
        RelDistribuicao.MdiParent = Me
        RelDistribuicao.Show()
    End Sub

    Private Sub MDIRibbonControle_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        Application.Exit()
    End Sub
End Class